package com.bawei.mall.product.util;

import org.springframework.core.io.ClassPathResource;

import java.io.*;

public class Object {

    /**
     * 方法五：使用Spring提供的ClassPathResource获取
     * 备注：jar包可用
     *
     * @param fileName
     * @return
     * @throws IOException
     */
    public BufferedReader function5(String fileName) throws IOException {
        ClassPathResource classPathResource = new ClassPathResource(fileName);
        InputStream inputStream = classPathResource.getInputStream();
        return new BufferedReader(new InputStreamReader(inputStream));
    }

}
